package router

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"mxshop-api/order-web/api/order"
	"mxshop-api/order-web/api/pay"
	"mxshop-api/order-web/middlewares"
)

/*
*
初始化订单的路由
*/
func InitOrderRouter(Router *gin.RouterGroup) {
	zap.S().Info("初始化订单的路由")
	OrderRouter := Router.Group("order").Use(middlewares.JWTAuth()).Use(middlewares.Tracing())
	{
		OrderRouter.GET("", order.List)       //订单列表
		OrderRouter.POST("", order.New)       //新建订单
		OrderRouter.GET("/:id", order.Detail) //订单详情
	}
	PayRouter := Router.Group("pay").Use(middlewares.JWTAuth())
	{
		PayRouter.POST("alipay/notify", pay.Notify)
	}
}
